// 导入创建路由的函数
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Home from "../views/home/index";
import My from "../views/my/index";
import Mains from "../views/Main/Mains";
import Notice from "../views/Notice/index";
import Update from "../views/update/index";

// 创建router路由实例对象，并配置路由对应关系（路由数组）
const router = createBrowserRouter([
  {
    path: "",
    element: <Mains />,
    children: [
      {
        path: "/",
        element: <Home></Home>,
      },
      {
        path: "/my",
        element: <My />,
      },
      {
        path: "/Notice",
        element: <Notice />,
      },
      {
        path: "/update",
        element: <Update />,
      },
    ],
  },
]);

export default function AppRouter() {
  return <RouterProvider router={router} />;
}
